<?php
/**
 * This file is part of Hyperf Mall.
 *
 * @link     https://gitee.com/scwlkj/hypref_mall
 * contact  hyperf_mall@163.com
 */
namespace App\JsonRpc;

use App\Repository\MessageRepository;
use Hyperf\RpcServer\Annotation\RpcService;
use App\JsonRpc\Interfaces\MessageServiceInterface;

/**
 * @RpcService(name="Member::MessageService", protocol="jsonrpc", server="jsonrpc")
 */
class MessageService extends BaseService implements MessageServiceInterface
{
    public function init()
    {
        $this->repository = MessageRepository::getInstance();
    }

    /**
     * Notes: 订单类消息添加
     * Author: Bruce.z
     * DateTime: 2022/7/20 11:58
     * @param $oid
     * @param int $member_id
     * @param int $type
     */
    public function orders($oid, int $member_id, int $type)
    {
        $this->repository->orders($oid, $member_id, $type);
    }

    /**
     * Notes: 消息已读
     * Author: Bruce.z
     * DateTime: 2022/7/20 13:31
     * @param $member_id
     * @return bool
     */
    public function messageRead($member_id):bool
    {
        return $this->repository->messageRead($member_id);
    }
}
